﻿using SHKF.B2C.Model.Dto;
using SHKF.B2C.Model.Entity.Center;
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace SHKF.B2C.Mannage.AdminUI.View.Set.Server
{
    /// <summary>
    /// frmDataBaseEdit.xaml 的交互逻辑
    /// </summary>
    public partial class frmDataBaseEdit : Window
    {
        public frmDataBaseEdit()
        {
            InitializeComponent();
        }

        private async void btnSave_Click(object sender, RoutedEventArgs e)
        {
            ErpDataBaseEntity data = (ErpDataBaseEntity)this.DataContext;
            DataDto dto = await GL.HttpClientManage.SaveErpDataBase(data);
            if (dto.error == null)
            {
                this.DialogResult = true;
                this.Close();
            }
            else
            {
                MessageBox.Show(dto.error.msg);
            }

        }

        private void btnCancel_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
            this.Close();
        }
    }
}
